import pygame
from gradient_color import *



WIN_SIZE = (1280, 960)
WIN_TITLE = "Demo"
MAX_FPS = 60


pygame.init()

pygame.display.set_caption(WIN_TITLE)
canvas = pygame.display.set_mode(WIN_SIZE)
clock = pygame.time.Clock()
running = True

gradient_surface1 = pygame.Surface((300, 300)).convert_alpha()
fill_linear_gradient_color(gradient_surface1, pygame.Color(155, 225, 93), pygame.Color(0, 227, 174), LinearGradientFillDirection.HORIZONTAL)

gradient_surface2 = pygame.Surface((300, 300)).convert_alpha()
fill_linear_gradient_color(gradient_surface2, pygame.Color(155, 225, 93), pygame.Color(0, 227, 174), LinearGradientFillDirection.VERTICAL)

gradient_surface3 = pygame.Surface((300, 300)).convert_alpha()
fill_linear_gradient_color(gradient_surface3, pygame.Color(155, 225, 93), pygame.Color(0, 227, 174), LinearGradientFillDirection.MAIN_DIAGONAL)

gradient_surface4 = pygame.Surface((300, 300)).convert_alpha()
fill_linear_gradient_color(gradient_surface4, pygame.Color(155, 225, 93), pygame.Color(0, 227, 174), LinearGradientFillDirection.SECONDARY_DIAGONAL)

gradient_surface5 = pygame.Surface((300, 500)).convert_alpha()
fill_radial_gradient_color(gradient_surface5, pygame.Color(155, 225, 93), pygame.Color(0, 227, 174), 250)

gradient_surface6 = pygame.Surface((500, 300)).convert_alpha()
fill_radial_gradient_color(gradient_surface6, pygame.Color(155, 225, 93), pygame.Color(0, 227, 174), 250)

gradient_surface7 = pygame.Surface((300, 300)).convert_alpha()
fill_radial_gradient_color(gradient_surface7, pygame.Color(155, 225, 93), pygame.Color(0, 227, 174), 150)


while running:
    clock.tick(MAX_FPS)
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            running = False
    
    canvas.fill((0, 0, 0))

    canvas.blit(gradient_surface1, (50, 50))
    canvas.blit(gradient_surface2, (350, 50))
    canvas.blit(gradient_surface3, (650, 50))
    canvas.blit(gradient_surface4, (950, 50))
    canvas.blit(gradient_surface5, (50, 350))
    canvas.blit(gradient_surface6, (400, 350))
    canvas.blit(gradient_surface7, (950, 350))

    pygame.display.flip()

pygame.quit()
